%define commit b9aeab7c0c1494dd26afda55eac74c309f50f96e
%define commit_short %(echo %{commit} | head -c6)

Summary(ru_RU.UTF-8):	Утилита для работы со значками
Summary:	Icons brwosing and editing utility
Name:		rublev
Version:	1
Release:	6.git%{commit_short}.1
License:	GPLv3
Group:		File tools
Url:		https://hub.mos.ru/mos/src/rublev
Source0:	https://hub.mos.ru/mos/src/rublev/-/archive/%{commit}/%{name}-%{commit}.tar.gz
BuildArch:	noarch
Vendor:		M OS
Requires:	python3-qtpy

%description -l ru_RU.UTF-8
Утилита для работы со значками

%description
Icons browsing and editing utility

%files
%{_bindir}/%name
%{_iconsdir}/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}/*
%{python3_sitelib}/rublev_modules

#------------------------------------------------------------------

%prep
%autosetup -n %{name}-%{commit}

%build

%install

mkdir %{buildroot}%{python3_sitelib}/rublev_modules
install -m644 rublev_get_icons.py %{buildroot}%{python3_sitelib}/rublev_modules
install -m644 rublev_screenshots.py %{buildroot}%{python3_sitelib}/rublev_modules
install -m644 rublev_palette.py %{buildroot}%{python3_sitelib}/rublev_modules

mkdir %{buildroot}%{_datadir}/%{name}
install -m644 *.svg %{buildroot}%{_datadir}/%{name}
install -m644 *.fig %{buildroot}%{_datadir}/%{name}
install -m644 *.qss %{buildroot}%{_datadir}/%{name}
install -m755 main.py %{buildroot}%{_datadir}/%{name}

mkdir -p %{buildroot}%{_iconsdir}/hicolor/scalable/apps
install -p -m644 %{name}.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps/%{name}.svg

mkdir -p %{buildroot}%{_datadir}/applications
install -m755 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop

ln -s ../share/%{name}/main.py %{buildroot}%{_bindir}/%{name}
